<template>
  <div class="home">
    <div class="banner">
      <img src="../../assets/img/avatar.jpg" alt />
    </div>
    <h3>爱时尚精品屋</h3>
    <div class="gg">公告：欢迎光临流行爆款库存有限请尽快下单</div>
    <Nav></Nav>
    <div class="list">
      <List></List>
      <router-link to="/cart" class="gwc">
    <img src="../../assets/img/cart.png" alt="">
    <div class="sl">
      {{gwclist.length}}
    </div>
    </router-link>
    </div>
  </div>
</template>

<script>

import List from './List'
import Nav from './Nav'
import {mapState} from 'vuex'
export default {
  components:{
    List,
    Nav
  },
  computed: {
    ...mapState(['gwclist'])
  },
};
</script>
<style lang="scss" scoped>
.home {
  width: 100%;
  height: 667px;
  .banner {
    width: 100%;
    height: 120px;
    background-image: url("../../assets/img/banner-2.png");
    background-position-y: center;
    background-position-x: center;
    background-size: 100%;
    position: relative;
    img {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      position: absolute;
      bottom: -25px;
      left: 50%;
      margin-left: -25px;
    }
  }
  h3 {
    width: 100%;
    height: 40px;
    text-align: center;
    line-height: 40px;
    margin-top: 20px;
  }
  .gg {
    width: 100%;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 12px;
  }
  .nav {
    display: flex;
    width: 100%;
    height: 40px;
    line-height: 40px;
    border-bottom: 1px solid #eee;
    text-align: center;
    .nav_item{
      flex: 1;
    }
  }
  .list{
    overflow: auto;
    height: 427px;
    width: 100%;
    .gwc{
      width: 50px;
      height: 50px;
      background: skyblue;
      position: absolute;
      right: 30px;
      bottom: 20px;
      text-align: center;
      border-radius: 50%;
      img{
        margin-top: 10px;
        width: 30px;
        height: 30px;
      }
      .sl{
        background: red;
        position: absolute;
        top: 0;
        right: 0;
        width: 20px;
        height: 20px;
        text-align: center;
        line-height: 20px;
        color: #fff;
        border-radius: 50%;
      }
    }
  }
}
</style>